<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of mat2cell2</title>
  <meta name="keywords" content="mat2cell2">
  <meta name="description" content="Break matrix up into a cell array of same sized matrices.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html matlab -->
<h1>mat2cell2
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Break matrix up into a cell array of same sized matrices.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function C = mat2cell2( X, parts ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Break matrix up into a cell array of same sized matrices.

 Useful wrapper for matlab function mat2cell.  Instead of specifying
 locations along each dimension at which to split the matrix, this
 function takes the number of parts along each dimension to break X into.
 That is if X is d1xd2x...xdk and parts=[p1 p2 ... pk]; then X is split
 into p1*p2*...*pk matricies of dimension d1/p1 x d2/p2 x ... x dk/pk. If
 di/pi is not an integer, floor(di/pi) is used.  Leftover chunks of X are
 discarded. Using a scalar p for parts is equivalent to using [p p ... p].

 So for example if X is 10*16, mat2cell2( X, [2 3] ) breaks X into 2*3
 parts, each of size 5x5, and the last column of X is discarded.

 USAGE
  C = mat2cell2( X, parts )

 INPUTS
  X       - matrix to split
  parts   - see above

 OUTPUTS
  C       - cell array adjacent submatrices of X

 EXAMPLE
  A=rand(6,10); B = mat2cell2(A,[3 3]),

 See also MAT2CELL, <a href="cell2array.html" class="code" title="function Y = cell2array( X, padEl )">CELL2ARRAY</a>, CELL2MAT

 Piotr's Computer Vision Matlab Toolbox      Version 3.02
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
